package demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
@EnableConfigurationProperties(MyConfiguration.class)
@EnableZuulProxy
public class Application{

	 final Logger logger = LoggerFactory.getLogger(getClass());
	 
	@Autowired
	private MyConfiguration configuration;
	
    @RequestMapping("/")
    public String home() {
        return "Zuul : " + configuration.getServiceId();
    }
    
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

